using System;
using Arles.src.view;
using Render;
using ArlesInterfaces.Editor;
using Arles.src.controller;

namespace Arles
{
    static class Program
    {
        static Game game;

        [STAThread]
        static void Main(string[] args)
        {
            Editor.Instance.MainForm = new FMainForm();
            ((FMainForm)Editor.Instance.MainForm).Disposed += new EventHandler(form_Disposed);
            using (game = new Game(Editor.Instance))
            {
                Editor.Instance.Render = game;
                ((FMainForm)Editor.Instance.MainForm).Show();
                ((FMainForm)Editor.Instance.MainForm).TopMost = true;
                ((Game)Editor.Instance.Render).Run();
            }
        }

        static void form_Disposed(object sender, EventArgs e)
        {
            game.Exit();
        }
    }
}

